import { NextResponse } from 'next/server';
import prisma from '@/lib/prisma';

export async function GET() {
  try {
    const musicList = await prisma.vms_music.findMany({
      orderBy: {
        create_time: 'desc'
      }
    });

    return NextResponse.json(musicList);
  } catch (error) {
    return NextResponse.json(
      { error: 'Failed to fetch music data' },
      { status: 500 }
    );
  }
}
